package com.remote.server.feigin;

import com.smartcar.common.domain.request.OrderRequest;
import com.smartcar.common.domain.response.OrderResponse;
import com.smartcar.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.ArrayList;
import java.util.List;

@FeignClient(name = "smartcar-order")
public interface OrderServiceFeigin {
    //TODO 获取所有订单
    @PostMapping("/orderList")
    public Result<ArrayList<OrderResponse>> orderList();

    //TODO 用户添加订单 -用户调用接口
    @PostMapping("/insertOrder")
    public void insertUserOrder(@RequestBody OrderRequest orderUserInsertRequest);

    // TODO 填入司机订单信息 -用户调用接口  修改
    @PostMapping("/insertOrderByDriver")
    public Result insertOrderByDriver(@RequestBody OrderRequest orderRequest);


    @PostMapping("/selectPcOrder")
    public Result<List<OrderRequest>> selectPcOrder();

    @PostMapping("/echoOrder")
    public OrderRequest findByIdOrder(Long id);

    @PostMapping("/updatePc")
    public Result<Integer> updatePc(@RequestBody OrderRequest orderRequest);
}
